<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册</title>
<link rel="stylesheet" href="../admin/css/bootstrap.min.css"
	type="text/css" />
<link rel="stylesheet" href="../admin/css/bootstrap-theme.min.css"
	type="text/css" />
<link rel="stylesheet" href="../admin/css/style.css" type="text/css" />
<script type="text/javascript" src="../admin/js/jquery.min.js"></script>
<script type="text/javascript" src="../admin/js/bootstrap.min.js"></script>
<style type="text/css" rel="stylesheet">
.container {
	margin: 50px auto;
	width: 1000px;
}
</style>
</head>
<body>
	<div class="container">
		<form class="form-horizontal" action="../SaveUserServlet" enctype="multipart/form-data"
			method="POST">
			<div class="form-group">
			    <label for="exampleInputFile col-md-2 control-label">头像</label>
			    <input type="file" id="exampleInputFile" name="adminImg">
			  </div>
			<div class="form-group">
				<label for="username" class="col-md-2 control-label">用户名：</label>
				<div class="col-md-10">
					<input type="text" class="col-md-4 form-control" id="username"
						placeholder="Username" name="username" value="${modifyAdminB.username}">
				</div>
			</div>

			<div class="form-group">
				<label for="password" class="col-md-2 control-label">密 码：</label>
				<div class="col-md-10">
					<input type="password" class="col-md-4 form-control" id="password"
						placeholder="Password" name="password" value="${modifyAdminB.password }">
				</div>
			</div>
			<div class="form-group">
				<label for="name" class="col-md-2 control-label">姓名：</label>
				<div class="col-md-10">
					<input type="text" class="col-md-4 form-control" id="name"
						placeholder="Username" name="name" value="${modifyAdminB.name}">
				</div>
			</div>
			<div class="form-group">
				<label class="radio-inline control-label col-md-2">
				性别：
				</label>
				<label class="radio-inline">
				  <input type="radio" name="sex" id="sex1" value="男"> 男
				</label>
			<label class="radio-inline">
			  <input type="radio" name="sex" id="sex2" value="女"> 女
			</label>
			</div>
			<div class="form-group">
				<label for="telnumber" class="col-md-2 control-label">手机号：</label>
				<div class="col-md-10">
					<input type="number" class="col-md-4 form-control" id="telnumber"
						placeholder="Telnumber" name="telphoneNumber" value="${modifyAdminB.telphoneNumber}">
				</div>
			</div>
			<div class="form-group">
				<label for="adminBirthday" class="col-sm-2 control-label">出生日期:</label>
				<div class="col-sm-4">
					<input type="date" class="form-control" id="adminBirthday"
						name="birthday" placeholder="Birthday" value="${modifyAdminB.birthday}">
				</div>
			</div>

			<div class="form-group">
				<label for="email" class="col-md-2 control-label">邮箱号：</label>
				<div class="col-md-10">
					<input type="email" class="col-md-4 form-control" id="email"
						placeholder="Email" name="email" value="${modifyAdminB.email}">
				</div>
			</div>

			<div class="form-group">
				<label for="address" class="col-md-2 control-label">收货地址：</label>
				<div class="col-md-10">
					<input type="email" class="col-md-4 form-control" id="address"
						placeholder="Address" name="address" value="${modifyAdminB.address}">
				</div>
			</div>
			<div class="form-group">
				<div class="col-md-offset-2 col-md-4">
					<button type="button" class="btn btn-primary btn-lg"
						onclick="validate(event)">注册</button>
				</div>
				<div class="col-md-offset-2 col-md-4">
					<button type="reset" class="btn btn-info btn-lg">重置</button>
				</div>
			</div>
		</form>
	</div>

	<script type="text/javascript">
		function validate(event) {
			var usernameText = $("#username").val();
			var passwordText = $("#password").val();
			var telnumberText = $("#telnumber").val();
			var emailText = $("#email").val();
			var addressText = $("#address").val();
			var msg = "";
			if (usernameText == null || usernameText.trim() == "") {
				msg = "您输入的用户名为空";
			}
			if (passwordText == null || passwordText.trim() == "") {
				msg = "您输入的密码为空";
			}
			if (telnumberText == null || telnumberText.trim() == "") {
				msg = "您输入的手机号为空";
			}
			if (emailText == null || emailText.trim() == "") {
				msg = "您输入的邮箱号为空";
			}
			if (addressText == null || addressText.trim() == "") {
				msg = "您输入的地址为空";
			}
			if (msg != "") {
				alert(msg);
			} else {
				$("form").submit();
			}
		}
	</script>
</body>
</html>
